
package com.cxx.purchasecharge.core.model.persistence;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
//import javax.persistence.Transient;

//import org.springframework.security.core.GrantedAuthority;

import com.cxx.purchasecharge.core.model.BaseModel;

/**
 * Permission entity.
 */
@Entity
@Table(name = "pc_permission")
public class Permission extends BaseModel 
//implements GrantedAuthority
{
    private static final long  serialVersionUID         = 3690197650654049848L;

    public final static String RECORD_ADD               = "RECORD_ADD";
    public final static String RECORD_DELETE            = "RECORD_DELETE";
    public final static String RECORD_EDIT              = "RECORD_EDIT";
    public final static String RECORD_VIEW              = "RECORD_VIEW";
    public final static String IDENTIFIER_DOMAIN_ADD    = "IDENTIFIER_DOMAIN_ADD";
    public final static String IDENTIFIER_DOMAIN_DELETE = "IDENTIFIER_DOMAIN_DELETE";
    public final static String IDENTIFIER_DOMAIN_EDIT   = "IDENTIFIER_DOMAIN_EDIT";
    public final static String IDENTIFIER_DOMAIN_VIEW   = "IDENTIFIER_DOMAIN_VIEW";
    public final static String RECORD_LINKS_REVIEW      = "RECORD_LINKS_REVIEW";
    public final static String REPORT_GENERATE          = "REPORT_GENERATE";
    public final static String REPORT_VIEW              = "REPORT_VIEW";
    public final static String CUSTOM_FIELDS_CONFIGURE  = "CUSTOM_FIELDS_CONFIGURE";
    public final static String BLOCKING_CONFIGURE       = "BLOCKING_CONFIGURE";
    public final static String MATCHING_CONFIGURE       = "MATCHING_CONFIGURE";
    public final static String FILE_IMPORT              = "FILE_IMPORT";
    public final static String USER_ADD                 = "USER_ADD";
    public final static String USER_DELETE              = "USER_DELETE";
    public final static String USER_EDIT                = "USER_EDIT";
    public final static String USER_VIEW                = "USER_VIEW";
    public final static String EVENT_CONFIGURATION_EDIT = "EVENT_CONFIGURATION_EDIT";
    public final static String GLOBAL_IDENTIFIERS_EDIT  = "GLOBAL_IDENTIFIERS_EDIT";
    public final static String PIXPDQ_MANAGE            = "PIXPDQ_MANAGE";

    private Integer            permissionId;
    private String             name;
    private String             description;

    /**
     * Default constructor - creates a new instance with no values set.
     */
    public Permission()
    {
    }

    public Permission(int permissionId, String name, String description)
    {
        this.permissionId = permissionId;
        this.name = name;
        this.description = description;
    }

    @Id
    @Column(name = "permission_id", unique = true, nullable = false)
    public Integer getPermissionId()
    {
        return permissionId;
    }

    public void setPermissionId(Integer permissionId)
    {
        this.permissionId = permissionId;
    }

    @Column(name = "permission_name", nullable = false)
    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    @Column(name = "permission_description", nullable = false)
    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    /*@Transient
    public String getAuthority()
    {
        return name;
    }*/

}
